home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gtk / gtknotebook.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  9.2 KB  |  244 lines

  1. /* GTK - The GIMP Toolkit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. #ifndef __GTK_NOTEBOOK_H__
  28. #define __GTK_NOTEBOOK_H__
  29.  
  30.  
  31. #include <gdk/gdk.h>
  32. #include <gtk/gtkcontainer.h>
  33.  
  34. G_BEGIN_DECLS
  35.  
  36. #define GTK_TYPE_NOTEBOOK                  (gtk_notebook_get_type ())
  37. #define GTK_NOTEBOOK(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NOTEBOOK, GtkNotebook))
  38. #define GTK_NOTEBOOK_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
  39. #define GTK_IS_NOTEBOOK(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NOTEBOOK))
  40. #define GTK_IS_NOTEBOOK_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
  41. #define GTK_NOTEBOOK_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
  42.  
  43.  
  44. typedef enum
  45. {
  46.   GTK_NOTEBOOK_TAB_FIRST,
  47.   GTK_NOTEBOOK_TAB_LAST
  48. } GtkNotebookTab;
  49.  
  50. typedef struct _GtkNotebook       GtkNotebook;
  51. typedef struct _GtkNotebookClass  GtkNotebookClass;
  52. typedef struct _GtkNotebookPage   GtkNotebookPage;
  53.  
  54. struct _GtkNotebook
  55. {
  56.   GtkContainer container;
  57.   
  58.   GtkNotebookPage *cur_page;
  59.   GList *children;
  60.   GList *first_tab;        /* The first tab visible (for scrolling notebooks) */
  61.   GList *focus_tab;
  62.   
  63.   GtkWidget *menu;
  64.   GdkWindow *event_window;
  65.   
  66.   guint32 timer;
  67.   
  68.   guint16 tab_hborder;
  69.   guint16 tab_vborder;
  70.   
  71.   guint show_tabs          : 1;
  72.   guint homogeneous        : 1;
  73.   guint show_border        : 1;
  74.   guint tab_pos            : 2;
  75.   guint scrollable         : 1;
  76.   guint in_child           : 3;
  77.   guint click_child        : 3;
  78.   guint button             : 2;
  79.   guint need_timer         : 1;
  80.   guint child_has_focus    : 1;
  81.   guint have_visible_child : 1;
  82.   guint focus_out          : 1;    /* Flag used by ::move-focus-out implementation */
  83.  
  84.   guint has_before_previous : 1;
  85.   guint has_before_next     : 1;
  86.   guint has_after_previous  : 1;
  87.   guint has_after_next      : 1;
  88. };
  89.  
  90. struct _GtkNotebookClass
  91. {
  92.   GtkContainerClass parent_class;
  93.   
  94.   void (* switch_page)       (GtkNotebook     *notebook,
  95.                               GtkNotebookPage *page,
  96.                   guint            page_num);
  97.  
  98.   /* Action signals for keybindings */
  99.   gboolean (* select_page)     (GtkNotebook       *notebook,
  100.                                 gboolean           move_focus);
  101.   gboolean (* focus_tab)       (GtkNotebook       *notebook,
  102.                                 GtkNotebookTab     type);
  103.   void (* change_current_page) (GtkNotebook       *notebook,
  104.                                 gint               offset);
  105.   void (* move_focus_out)      (GtkNotebook       *notebook,
  106.                 GtkDirectionType   direction);
  107.  
  108.   /* Padding for future expansion */
  109.   void (*_gtk_reserved1) (void);
  110.   void (*_gtk_reserved2) (void);
  111.   void (*_gtk_reserved3) (void);
  112.   void (*_gtk_reserved4) (void);
  113. };
  114.  
  115. /***********************************************************
  116.  *           Creation, insertion, deletion                 *
  117.  ***********************************************************/
  118.  
  119. GType   gtk_notebook_get_type       (void) G_GNUC_CONST;
  120. GtkWidget * gtk_notebook_new        (void);
  121. gint gtk_notebook_append_page       (GtkNotebook *notebook,
  122.                      GtkWidget   *child,
  123.                      GtkWidget   *tab_label);
  124. gint gtk_notebook_append_page_menu  (GtkNotebook *notebook,
  125.                      GtkWidget   *child,
  126.                      GtkWidget   *tab_label,
  127.                      GtkWidget   *menu_label);
  128. gint gtk_notebook_prepend_page      (GtkNotebook *notebook,
  129.                      GtkWidget   *child,
  130.                      GtkWidget   *tab_label);
  131. gint gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
  132.                      GtkWidget   *child,
  133.                      GtkWidget   *tab_label,
  134.                      GtkWidget   *menu_label);
  135. gint gtk_notebook_insert_page       (GtkNotebook *notebook,
  136.                      GtkWidget   *child,
  137.                      GtkWidget   *tab_label,
  138.                      gint         position);
  139. gint gtk_notebook_insert_page_menu  (GtkNotebook *notebook,
  140.                      GtkWidget   *child,
  141.                      GtkWidget   *tab_label,
  142.                      GtkWidget   *menu_label,
  143.                      gint         position);
  144. void gtk_notebook_remove_page       (GtkNotebook *notebook,
  145.                      gint         page_num);
  146.  
  147. /***********************************************************
  148.  *            query, set current NoteebookPage             *
  149.  ***********************************************************/
  150.  
  151. gint       gtk_notebook_get_current_page (GtkNotebook *notebook);
  152. GtkWidget* gtk_notebook_get_nth_page     (GtkNotebook *notebook,
  153.                       gint         page_num);
  154. gint       gtk_notebook_get_n_pages      (GtkNotebook *notebook);
  155. gint       gtk_notebook_page_num         (GtkNotebook *notebook,
  156.                       GtkWidget   *child);
  157. void       gtk_notebook_set_current_page (GtkNotebook *notebook,
  158.                       gint         page_num);
  159. void       gtk_notebook_next_page        (GtkNotebook *notebook);
  160. void       gtk_notebook_prev_page        (GtkNotebook *notebook);
  161.  
  162. /***********************************************************
  163.  *            set Notebook, NotebookTab style              *
  164.  ***********************************************************/
  165.  
  166. void     gtk_notebook_set_show_border      (GtkNotebook     *notebook,
  167.                         gboolean         show_border);
  168. gboolean gtk_notebook_get_show_border      (GtkNotebook     *notebook);
  169. void     gtk_notebook_set_show_tabs        (GtkNotebook     *notebook,
  170.                         gboolean         show_tabs);
  171. gboolean gtk_notebook_get_show_tabs        (GtkNotebook     *notebook);
  172. void     gtk_notebook_set_tab_pos          (GtkNotebook     *notebook,
  173.                             GtkPositionType  pos);
  174. GtkPositionType gtk_notebook_get_tab_pos   (GtkNotebook     *notebook);
  175.  
  176. #ifndef GTK_DISABLE_DEPRECATED
  177. void     gtk_notebook_set_homogeneous_tabs (GtkNotebook     *notebook,
  178.                         gboolean         homogeneous);
  179. void     gtk_notebook_set_tab_border       (GtkNotebook     *notebook,
  180.                         guint            border_width);
  181. void     gtk_notebook_set_tab_hborder      (GtkNotebook     *notebook,
  182.                         guint            tab_hborder);
  183. void     gtk_notebook_set_tab_vborder      (GtkNotebook     *notebook,
  184.                         guint            tab_vborder);
  185. #endif /* GTK_DISABLE_DEPRECATED */
  186.  
  187. void     gtk_notebook_set_scrollable       (GtkNotebook     *notebook,
  188.                         gboolean         scrollable);
  189. gboolean gtk_notebook_get_scrollable       (GtkNotebook     *notebook);
  190.  
  191. /***********************************************************
  192.  *               enable/disable PopupMenu                  *
  193.  ***********************************************************/
  194.  
  195. void gtk_notebook_popup_enable  (GtkNotebook *notebook);
  196. void gtk_notebook_popup_disable (GtkNotebook *notebook);
  197.  
  198. /***********************************************************
  199.  *             query/set NotebookPage Properties           *
  200.  ***********************************************************/
  201.  
  202. GtkWidget * gtk_notebook_get_tab_label    (GtkNotebook *notebook,
  203.                        GtkWidget   *child);
  204. void gtk_notebook_set_tab_label           (GtkNotebook *notebook,
  205.                        GtkWidget   *child,
  206.                        GtkWidget   *tab_label);
  207. void gtk_notebook_set_tab_label_text      (GtkNotebook *notebook,
  208.                        GtkWidget   *child,
  209.                        const gchar *tab_text);
  210. G_CONST_RETURN gchar *gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
  211.                                GtkWidget   *child);
  212. GtkWidget * gtk_notebook_get_menu_label   (GtkNotebook *notebook,
  213.                        GtkWidget   *child);
  214. void gtk_notebook_set_menu_label          (GtkNotebook *notebook,
  215.                        GtkWidget   *child,
  216.                        GtkWidget   *menu_label);
  217. void gtk_notebook_set_menu_label_text     (GtkNotebook *notebook,
  218.                        GtkWidget   *child,
  219.                        const gchar *menu_text);
  220. G_CONST_RETURN gchar *gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
  221.                             GtkWidget   *child);
  222. void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook,
  223.                        GtkWidget   *child,
  224.                        gboolean    *expand,
  225.                        gboolean    *fill,
  226.                        GtkPackType *pack_type);
  227. void gtk_notebook_set_tab_label_packing   (GtkNotebook *notebook,
  228.                        GtkWidget   *child,
  229.                        gboolean     expand,
  230.                        gboolean     fill,
  231.                        GtkPackType  pack_type);
  232. void gtk_notebook_reorder_child           (GtkNotebook *notebook,
  233.                        GtkWidget   *child,
  234.                        gint         position);
  235.  
  236. #ifndef GTK_DISABLE_DEPRECATED
  237. #define    gtk_notebook_current_page               gtk_notebook_get_current_page
  238. #define gtk_notebook_set_page                   gtk_notebook_set_current_page
  239. #endif /* GTK_DISABLE_DEPRECATED */
  240.  
  241. G_END_DECLS
  242.  
  243. #endif /* __GTK_NOTEBOOK_H__ */
  244.